<!DOCTYPE HTML>
<html class="fn">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="renderer" content="webkit">
		<meta itemprop="image" content="/static/img/share_logo_message.png">
		<title>易控-请输入访问密码</title>
		<link rel="shortcut icon" href="/favicon.ico" />
		<link rel="stylesheet" href="/static/js/bootstrap/css/bootstrap.min.css" type="text/css"/>
		<link rel="stylesheet" type="text/css" href="/static/css/waifa.css">
		<link rel="stylesheet" type="text/css" href="/static/css/down_home.css">
	</head>
	<body>
		<div class="header">
			<div class="h-logo">
				<a target="_self" href="/home" class="logo-bd"></a>
			</div>
		</div>
		<div class="down-main">
			<div class="tool-view">
			</div>
			<form action="" method="post" onsubmit="return false">
			<div class="form-box" id="form-box">
				<div class="icon-box">
					<i class="icon-share-check icon-lock"></i>
				</div>
				<div class="input-box">
					<label for="share_pwd">访问密码</label>
					<input type="text" id="share_pwd" class="share_pwd" maxlength="4" />
					<label class="icon-share-check state"></label>
				</div>
				<div class="btn-box">
					<button class="conf-btn" id="conf-btn">确定</button>
				</div>
			</div>
			</form>
		</div>
		<script type="text/javascript" src="/static/js/jquery/jquery.js"></script>
		{literal}
		<script type="text/javascript">
			$(function(){
				
				/*body高度*/
				/*
				(function(){
					var bodyHeight = $('body').height();
					setBodyHeight(bodyHeight);
					$(window).resize(function(){
						setBodyHeight(bodyHeight);
					});
					function setBodyHeight(bodyHeight){
						if(bodyHeight < $(window).height()){
							$('body').height($(window).height());
						}else{
							$('body').height(bodyHeight);
						}
					}
				})();
				*/
				
				$('#conf-btn').on('click', function(){
					var pwd = $('#share_pwd').val();
					var share_code = $('#share_code').val();
					var status = $('#form-box').find('.state');
					var share_uniqid = $('#share_uniqid').val();
					if(!pwd || pwd.length < 4){
						status.removeClass('success').addClass('error');
						$('#share_pwd').focus();
						return;
					}
					$.post('/share_check/check', {pwd: pwd, share_code: share_code, share_uniqid: share_uniqid}, function(data){

						var respObj = $.parseJSON(data);
						if(respObj.error_code == 0){
							status.addClass('success');
							window.location.href="/s/"+share_code;
						} else {
							status.removeClass('success').addClass('error');
							$('#share_pwd').focus();
						}
					});
				});
			});
		</script>
		{/literal}
		<input type="hidden" value="{$share_code}" id="share_code" />
		<input type="hidden" value="{$share_uniqid}" id="share_uniqid" />
	</body>
</html>